﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DTO
{
    /// <summary>
    /// This class represents the tag structure of a webpage.
    /// </summary>
    public class Link
    {
        #region Attributes
        int sourceWebpageID;
        int destWebpageID;
        string destURL;
        string text;
        string tagXpath;
        #endregion

        #region Properties
        /// <summary>
        /// The ID of the destination webpage in this link.
        /// </summary>
        public int DestWebpageID
        {
            get { return destWebpageID; }
            set { destWebpageID = value; }
        }
        
        /// <summary>
        /// The ID of the source webpage in this link.
        /// </summary>
        public int SourceWebpageID
        {
            get { return sourceWebpageID; }
            set { sourceWebpageID = value; }
        }

        /// <summary>
        /// The xPath of the tag that contains this link.
        /// </summary>
        public string TagXpath
        {
            get { return tagXpath; }
            set { tagXpath = value; }
        }
        /// <summary>
        /// The destination link.
        /// </summary>
        public string DestURL
        {
            get
            {
                return destURL;
            }
            set
            {
                destURL = value;
            }
        }

        /// <summary>
        /// The inner text of this tag. Empty string if this tag contains other tag(s) or this tag has no text inside.
        /// </summary>
        public string Text
        {
            get
            {
                return text;
            }
            set
            {
                text = value;
            }
        }

        #endregion

        #region Constructors
        public Link()
        {
        }

        public Link(string destURL, string text)
        {
            this.text = text;
            this.destURL = destURL;
        }

        public Link(int sourceWebpageID, int destWebpageID)
        {
            // TODO: Complete member initialization
            this.sourceWebpageID = sourceWebpageID;
            this.destWebpageID = destWebpageID;
        }
        #endregion
    }
}
